<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <script>
    function fun1() {
      return new Promise((resolve, reject) => {
        setTimeout(() => {
          resolve('定时器第一个4s');
        }, 4000);
      })
    }
    function fun2() {
      return new Promise((resolve, reject) => {
        setTimeout(() => {
          resolve('定时器第二个3s');
        }, 3000);
      })
    }
    function fun3() {
      return new Promise((resolve, reject) => {
        setTimeout(() => {
          resolve('定时器第三个2s');
        }, 2000);
      })
    }

    fun1().then(result => {
      console.log(result);
      return fun2()
    }).then(result => {
      console.log(result);
      return fun3()
    }).then(result => {
      console.log(result);
    })


  </script>
</body>

</html>